﻿using System;

namespace IInject.Registration.Scanning
{
	public class PublicClassScanningRule : ScanningRule
	{
		public override ScanningRuleType Type
		{
			get
			{
				return ScanningRuleType.Custom;
			}
		}

		public override MatchingResult IsMatch(Type type)
		{
			return new MatchingResult
			{
				From = type,
				IsMatch = IsPublicClass(type),
			};
		}

		protected virtual bool IsPublicClass(Type type)
		{
			return type.IsPublicClass();
		}
	}
}
